#region imports

using System;
using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using MimeCloud.AssetManagement.Business.Interface;

#endregion

namespace MimeCloud.AssetManagement.Business
{
    [Serializable]
    public class AssetContentType : IAssetContentType
    {
        #region properties

        [XmlElement ( "id" )]
        public int ID { get; set; }
        
        [XmlElement ( "name" )]
        public string Name { get; set; }
        
        [XmlIgnore]
        public string Description { get; set; }
        
        [XmlElement ( "enabled" )]
        public bool Enabled { get; set; }
        
        [XmlElement ( "width" )]
        public decimal Width { get; set; }

        [XmlAttribute("type")]
        public TypeOfContent ContentType
        {
            get; set;
        }

        [XmlElement ( "height" )]
        public decimal Height { get; set; }

        #endregion

        #region constructors

        public AssetContentType ( ) { }

        public AssetContentType ( int id , string name , string description , bool enabled , decimal width , decimal height, TypeOfContent contentType )
        {
            this.ID = id;
            this.Name = name;
            this.Description = description;
            this.Enabled = enabled;
            this.Width = width;
            this.Height = height;
            this.ContentType = contentType;
        }

        public AssetContentType ( IAssetContentType entity )
        {
            this.ID = entity.ID;
            this.Name = entity.Name;
            this.Description = entity.Description;
            this.Enabled = entity.Enabled;
            this.Width = entity.Width;
            this.Height = entity.Height;
            this.ContentType = entity.ContentType;
        }

        #endregion

        #region overridden methods

        public override string ToString ( )
        {
            return string.Format ( "ID: {0} - Name: {1} - Desc: {2} - Enabled: {3} - Width: {4} - Height: {5} - Type: {6}" , ID.ToString ( ) , Name , Description , Enabled.ToString ( ) , Width.ToString ( ) , Height.ToString ( ) , ContentType.ToString());









        }

        #endregion
    }
}
